package sjtu.sonnet.LDAPModule.logic.interfraces;

import java.util.Vector;

import sjtu.sonnet.LDAPModule.RBAC.model.group.iGroup;
import sjtu.sonnet.LDAPModule.RBAC.model.permission.iPermission;
import sjtu.sonnet.LDAPModule.RBAC.model.resource.AbstractResource;
import sjtu.sonnet.LDAPModule.RBAC.model.role.iRole;
import sjtu.sonnet.LDAPModule.RBAC.model.user.iUser;
import sjtu.sonnet.LDAPModule.service.exception.LDAPAddResourceException;
import sjtu.sonnet.LDAPModule.service.exception.LDAPAddRoleException;
import sjtu.sonnet.LDAPModule.service.exception.LDAPAddUserException;
import sjtu.sonnet.LDAPModule.service.exception.LDAPAddUserGroupException;
import sjtu.sonnet.LDAPModule.service.exception.LDAPDeleteRoleException;
import sjtu.sonnet.LDAPModule.service.exception.LDAPDeleteUserGroupException;
import sjtu.sonnet.LDAPModule.service.interfaces.LDAPService;

public interface RBACModelController {
	public void addUserGroup(iGroup group);

	public void addUserGroup(iGroup group, iGroup parentGroup)
			throws LDAPAddUserGroupException;

	public void addUserGroup(iGroup group, String parentGroupName)
			throws LDAPAddUserGroupException;

	public void deleteUserGroup(String groupName)
			throws LDAPDeleteUserGroupException;

	public iGroup getUserGroupByName(String name);

	public void addRole(iRole role) throws LDAPAddRoleException;

	public void addPermissionToRole(iRole role, iPermission permission);

	public void deleteRole(String roleName) throws LDAPDeleteRoleException;

	public iRole getRoleByName(String name);

	public void setLdapService(LDAPService ldapService);

	public LDAPService getLdapService();

	public Vector<iRole> getAllRoles(iGroup group);

	public Vector<iGroup> getAllGroup();

	public void addResource(AbstractResource resource)
			throws LDAPAddResourceException;

	public Vector<AbstractResource> getAllResources(iGroup group);

	public Vector<iUser> getAllUsers();

	public Vector<iUser> getAllUsers(iGroup group);

	public void addUser(iUser user) throws LDAPAddUserException;

}
